/** 
* All Rights Reserved , Copyright (C) 2023 , 青岛鼎信通讯股份有限公司
* 
* QemProblemAlertServiceAuto
* 问题告警表
* 
* 修改纪录
* 2023-01-06 版本：1.0 xinfushuo 创建。
* @version 版本：1.0
* @author 作者：xinfushuo
* 创建日期：2023-01-06
*/

package com.topscomm.qem.service.impl.auto;

import javax.annotation.Resource;
import com.topscomm.basic.IBasicDao;
import com.topscomm.tap.common.DatacodeCache;
import java.util.Map;
import com.topscomm.qem.*;
import com.topscomm.qem.pojo.QemProblemAlertEntity;
import com.topscomm.qem.dao.IQemProblemAlertDao;


public class QemProblemAlertServiceAuto extends QemService<QemProblemAlertEntity,IQemProblemAlertDao> {
	
	/**
	 * @author: xinfushuo
	 * @date: 2023-01-06
	 * @param mapRow
	 * @description:设置字段显示值
	 * @modify:
	 */
	@Override
	public void setDispFields(Map<String, Object> mapRow, DatacodeCache datacodeCache) {
		String temp;
		if (mapRow.get("problemgrading") != null) {
			temp = mapRow.get("problemgrading").toString();
			mapRow.put("dispproblemgrading", datacodeCache.getValueDynamic("QemProblemgrading", temp, "code", "name"));
		}
		if (mapRow.get("sourcetype") != null) {
			temp = mapRow.get("sourcetype").toString();
			mapRow.put("dispsourcetype", datacodeCache.getValueDynamic("QemProblemSourcetype", temp, "code", "name"));
		}
		if (mapRow.get("happennode") != null) {
			temp = mapRow.get("happennode").toString();
			mapRow.put("disphappennode", datacodeCache.getValueDynamic("QemProblemHappennode", temp, "code", "name"));
		}
		if (mapRow.get("ipdnode") != null) {
			temp = mapRow.get("ipdnode").toString();
			mapRow.put("dispipdnode", datacodeCache.getValueDynamic("QemProblemIpdnode", temp, "code", "name"));
		}
		if (mapRow.get("requirements") != null) {
			temp = mapRow.get("requirements").toString();
			mapRow.put("disprequirements", datacodeCache.getValueDynamic("QemProblemRequirements", temp, "code", "name"));
		}
		if (mapRow.get("pathway") != null) {
			temp = mapRow.get("pathway").toString();
			mapRow.put("disppathway", datacodeCache.getValueDynamic("QemProblemPathway", temp, "code", "name"));
		}
		if (mapRow.get("emergenttreatment") != null) {
			temp = mapRow.get("emergenttreatment").toString();
			mapRow.put("dispemergenttreatment", datacodeCache.getValueDynamic("QemProblemEmergenttreatment", temp, "code", "name"));
		}
		if (mapRow.get("repeat") != null) {
			temp = mapRow.get("repeat").toString();
			mapRow.put("disprepeat", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}
		if (mapRow.get("flowid") != null) {
			temp = mapRow.get("flowid").toString();
			mapRow.put("dispflowid", datacodeCache.getValueDynamic("ApprovalFlow_QemProblemAlert", temp, "id", "name"));
		}
		if (mapRow.get("state") != null) {
			temp = mapRow.get("state").toString();
			mapRow.put("dispstate", datacodeCache.getValueDynamic("TapApprovalBillState", temp, "code", "name"));
		}
		if (mapRow.get("enabled") != null) {
			temp = mapRow.get("enabled").toString();
			mapRow.put("dispenabled", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
			// 用于前端导出作废字段
			mapRow.put("dispcancel", datacodeCache.getValueDynamic("QemCancel", temp, "code", "name"));
		}
	}

	@Override
	@Resource(name = "qemProblemAlertDao")
	public void setDao(IBasicDao<QemProblemAlertEntity> dao) {		
		super.setDao(dao);
	}
}
